package handler;

import view.LoginStudentView;
import view.LoginView;
import view.Main;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter;

public class LoginHandler2 extends KeyAdapter implements ActionListener {
    private Main main;

    public LoginHandler2(Main main) {
        this.main = main;
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        JButton jButton = (JButton) e.getSource();
        String text = jButton.getText();
        if ("教师端".equals(text)) {
            new LoginView();
            //new AddCourseView();
            //main.dispose();
            // System.out.println("学生端");
        } else if ("学生端".equals(text)) {
            new LoginStudentView();
            //System.out.println("学生端");
        }
    }
}
